
/******************************************************************************\
|    Title:        	 FIGURE1: Number of covered staff over time				   |
|    Date:         	 July 2023	                                         	   |
|    Author:         Elisa Wirsching	      							       |
\******************************************************************************/


clear all
set more off, permanently
numlabel, add
set maxvar 32000

use congress_yearly.dta, clear

* Share of covered staff (overall) by year
bysort year: egen treat_mean = mean(treatment)

* Share of covered staff by position and year
foreach var in senate_everyear house_everyear personalstaff_everyear committeestaff_everyear {
    bysort year: egen treat_`var' = mean(treatment) if `var'==1
}

* Retain only one observation by year
collapse treat_*, by(year)

* Plot shares over time
twoway (line treat_mean year, lcolor(black) lwidth(medthick)) ///
 (line treat_committeestaff year, lcolor(gs6)) ///
 (line treat_personalstaff year, lcolor(gs6) lpattern(dash)) ///
 (line treat_senate year, lcolor(gs6) lpattern(shortdash_dot)) ///
 (line treat_house year, lcolor(gs6) lpattern(dot)), ///
 graphregion(color(white)) xtitle("Year") ytitle("Share of staff covered") ///
 xline(2008, lcolor(black)) ttext(.4 2012 "Post HLOGA", size(small)) ttext(.4 2004 "Pre HLOGA", size(small)) ///
 legend(size(small) holes(2) label(1 "All") label(2 "Committee staff") label(3 "Personal staff") label(4 "Senate staff") label(5 "House staff"))
 
